import { InputType, StrategyKey, generateRandomId } from '@/utils';
import type { BaseTableConfig } from '@/components/base-ui/base-table/type';

export const tableConfig: BaseTableConfig = {
    items: [
        {
            modelKey: 'customerCode',
            columnProps: {
                label: '客户编码',
                width: 200
            },
            elInputProps: {
                maxlength: '50',
                showWordLimit: true
            },
            validProps: {
                id: generateRandomId(),
                required: true
            },
            validFormatType: InputType.NUMERIC_ALPHABET_SYMBOLS
        },
        {
            modelKey: 'customerCompanyName',
            columnProps: {
                label: '客户公司名称',
                width: 200
            },
            elInputProps: {
                maxlength: '50',
                showWordLimit: true
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'customerName',
            columnProps: {
                label: '客户姓名',
                width: 200
            },
            elInputProps: {
                maxlength: '50',
                showWordLimit: true
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'customerPhone',
            columnProps: {
                label: '客户电话',
                width: 200
            },
            elInputProps: {
                maxlength: '20',
                showWordLimit: true
            },
            validProps: {
                id: generateRandomId(),
                required: true
            },
            validRules: [
                {
                    validType: StrategyKey.IS_MOBILE_OR_TELEPHONE,
                    errMsg: '电话号码格式不正确'
                }
            ],
            validFormatType: InputType.NUMERIC_ALPHABET_SYMBOLS
        },
        {
            itemType: 'select',
            modelKey: 'customerPriority',
            elSelectProps: {
                options: [
                    {
                        label: '1',
                        value: '1'
                    },
                    {
                        label: '2',
                        value: '2'
                    },
                    {
                        label: '3',
                        value: '3'
                    },
                    {
                        label: '4',
                        value: '4'
                    },
                    {
                        label: '5',
                        value: '5'
                    }
                ]
            },
            columnProps: {
                label: '客户优先级',
                width: 200
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        }
    ],
    unAction: true
};
